using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Com.Grubbland.Data.Access;
using Com.Grubbland.Data.Objects;

public partial class admin_processBOW : System.Web.UI.Page
{
    private ActivityServiceImpl _actImpl = new ActivityServiceImpl();
    private AssessmentServiceImpl _assImpl = new AssessmentServiceImpl();

    protected void Page_Load(object sender, EventArgs e)
    {

        Response.Write("test");
        List<Question> qList = new List<Question>();
        Question q = new Question();
        q.Text = Request["url"];
        q.PointsPossible = 10;
        q.TypeId = 2;
        q.Id = _assImpl.InsertQuestion(q);

        if (q.Id != null)
        {
            qList.Add(q);


            Activity a = new Activity();
            a.Title = Request["title"];
            a.CatalogNumber = Request["catalog_id"];
            a.Description = Request["description"];
            a.HasRemoteData = true;
            a.MediaType.Id = 7;
            a.MediaSubType.Id = 2;
            a.PosterId = Profile.UserName;
            a.TemplateId = "9609ba4a-32fb-4d9d-8469-81bd4d7c9908";
            a.URI = "BOWVideoPlayer.swf";
            a.VersionId = "1";
            a.ActivityType.Id = 1;

            a.Data = qList;

            a.Id = _actImpl.AddActivity(a);

            if (a.Id == null)
            {
                Response.Write("ERROR ADDING ACTIVITY");

            }
            else
            {
                Response.RedirectLocation = "AddBestOfTheWeb.aspx";
            }
        }
    }
}
